/*
 *  This file is part of the SIRIUS libraries for analyzing MS and MS/MS data
 *
 *  Copyright (C) 2024 Bright Giant GmbH
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along with SIRIUS.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 *  https://openapi-generator.tech
 *  Do not edit the class manually.
 */


package io.sirius.ms.sdk.model;

import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;

/**
 * FragmentNode
 */
@JsonPropertyOrder({
  FragmentNode.JSON_PROPERTY_FRAGMENT_ID,
  FragmentNode.JSON_PROPERTY_MOLECULAR_FORMULA,
  FragmentNode.JSON_PROPERTY_ADDUCT,
  FragmentNode.JSON_PROPERTY_MASS_DEVIATION_DA,
  FragmentNode.JSON_PROPERTY_MASS_DEVIATION_PPM,
  FragmentNode.JSON_PROPERTY_SCORE,
  FragmentNode.JSON_PROPERTY_INTENSITY,
  FragmentNode.JSON_PROPERTY_MZ
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0")
public class FragmentNode {
  public static final String JSON_PROPERTY_FRAGMENT_ID = "fragmentId";
  @jakarta.annotation.Nullable
  private Integer fragmentId;

  public static final String JSON_PROPERTY_MOLECULAR_FORMULA = "molecularFormula";
  @jakarta.annotation.Nullable
  private String molecularFormula;

  public static final String JSON_PROPERTY_ADDUCT = "adduct";
  @jakarta.annotation.Nullable
  private String adduct;

  public static final String JSON_PROPERTY_MASS_DEVIATION_DA = "massDeviationDa";
  @jakarta.annotation.Nullable
  private Double massDeviationDa;

  public static final String JSON_PROPERTY_MASS_DEVIATION_PPM = "massDeviationPpm";
  @jakarta.annotation.Nullable
  private Double massDeviationPpm;

  public static final String JSON_PROPERTY_SCORE = "score";
  @jakarta.annotation.Nullable
  private Double score;

  public static final String JSON_PROPERTY_INTENSITY = "intensity";
  @jakarta.annotation.Nullable
  private Double intensity;

  public static final String JSON_PROPERTY_MZ = "mz";
  @jakarta.annotation.Nullable
  private Double mz;

  public FragmentNode() {
  }

  public FragmentNode fragmentId(@jakarta.annotation.Nullable Integer fragmentId) {
    
    this.fragmentId = fragmentId;
    return this;
  }

  /**
   * Get fragmentId
   * @return fragmentId
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_FRAGMENT_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Integer getFragmentId() {
    return fragmentId;
  }


  @JsonProperty(JSON_PROPERTY_FRAGMENT_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setFragmentId(@jakarta.annotation.Nullable Integer fragmentId) {
    this.fragmentId = fragmentId;
  }

  public FragmentNode molecularFormula(@jakarta.annotation.Nullable String molecularFormula) {
    
    this.molecularFormula = molecularFormula;
    return this;
  }

  /**
   * neutral molecular formula of the fragment without adduct
   * @return molecularFormula
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_MOLECULAR_FORMULA)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getMolecularFormula() {
    return molecularFormula;
  }


  @JsonProperty(JSON_PROPERTY_MOLECULAR_FORMULA)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMolecularFormula(@jakarta.annotation.Nullable String molecularFormula) {
    this.molecularFormula = molecularFormula;
  }

  public FragmentNode adduct(@jakarta.annotation.Nullable String adduct) {
    
    this.adduct = adduct;
    return this;
  }

  /**
   * This combines the ionization plus adduct of the fragment. In contrast to the {@link FragmentationTree FragmentationTree}s adduct,  this adduct may not include any in-source loss.
   * @return adduct
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_ADDUCT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getAdduct() {
    return adduct;
  }


  @JsonProperty(JSON_PROPERTY_ADDUCT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setAdduct(@jakarta.annotation.Nullable String adduct) {
    this.adduct = adduct;
  }

  public FragmentNode massDeviationDa(@jakarta.annotation.Nullable Double massDeviationDa) {
    
    this.massDeviationDa = massDeviationDa;
    return this;
  }

  /**
   * Get massDeviationDa
   * @return massDeviationDa
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_MASS_DEVIATION_DA)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Double getMassDeviationDa() {
    return massDeviationDa;
  }


  @JsonProperty(JSON_PROPERTY_MASS_DEVIATION_DA)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMassDeviationDa(@jakarta.annotation.Nullable Double massDeviationDa) {
    this.massDeviationDa = massDeviationDa;
  }

  public FragmentNode massDeviationPpm(@jakarta.annotation.Nullable Double massDeviationPpm) {
    
    this.massDeviationPpm = massDeviationPpm;
    return this;
  }

  /**
   * Get massDeviationPpm
   * @return massDeviationPpm
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_MASS_DEVIATION_PPM)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Double getMassDeviationPpm() {
    return massDeviationPpm;
  }


  @JsonProperty(JSON_PROPERTY_MASS_DEVIATION_PPM)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMassDeviationPpm(@jakarta.annotation.Nullable Double massDeviationPpm) {
    this.massDeviationPpm = massDeviationPpm;
  }

  public FragmentNode score(@jakarta.annotation.Nullable Double score) {
    
    this.score = score;
    return this;
  }

  /**
   * Get score
   * @return score
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_SCORE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Double getScore() {
    return score;
  }


  @JsonProperty(JSON_PROPERTY_SCORE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setScore(@jakarta.annotation.Nullable Double score) {
    this.score = score;
  }

  public FragmentNode intensity(@jakarta.annotation.Nullable Double intensity) {
    
    this.intensity = intensity;
    return this;
  }

  /**
   * Get intensity
   * @return intensity
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_INTENSITY)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Double getIntensity() {
    return intensity;
  }


  @JsonProperty(JSON_PROPERTY_INTENSITY)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setIntensity(@jakarta.annotation.Nullable Double intensity) {
    this.intensity = intensity;
  }

  public FragmentNode mz(@jakarta.annotation.Nullable Double mz) {
    
    this.mz = mz;
    return this;
  }

  /**
   * Get mz
   * @return mz
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_MZ)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Double getMz() {
    return mz;
  }


  @JsonProperty(JSON_PROPERTY_MZ)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMz(@jakarta.annotation.Nullable Double mz) {
    this.mz = mz;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    FragmentNode fragmentNode = (FragmentNode) o;
    return Objects.equals(this.fragmentId, fragmentNode.fragmentId) &&
        Objects.equals(this.molecularFormula, fragmentNode.molecularFormula) &&
        Objects.equals(this.adduct, fragmentNode.adduct) &&
        Objects.equals(this.massDeviationDa, fragmentNode.massDeviationDa) &&
        Objects.equals(this.massDeviationPpm, fragmentNode.massDeviationPpm) &&
        Objects.equals(this.score, fragmentNode.score) &&
        Objects.equals(this.intensity, fragmentNode.intensity) &&
        Objects.equals(this.mz, fragmentNode.mz);
  }

  @Override
  public int hashCode() {
    return Objects.hash(fragmentId, molecularFormula, adduct, massDeviationDa, massDeviationPpm, score, intensity, mz);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class FragmentNode {\n");
    sb.append("    fragmentId: ").append(toIndentedString(fragmentId)).append("\n");
    sb.append("    molecularFormula: ").append(toIndentedString(molecularFormula)).append("\n");
    sb.append("    adduct: ").append(toIndentedString(adduct)).append("\n");
    sb.append("    massDeviationDa: ").append(toIndentedString(massDeviationDa)).append("\n");
    sb.append("    massDeviationPpm: ").append(toIndentedString(massDeviationPpm)).append("\n");
    sb.append("    score: ").append(toIndentedString(score)).append("\n");
    sb.append("    intensity: ").append(toIndentedString(intensity)).append("\n");
    sb.append("    mz: ").append(toIndentedString(mz)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

